home *** CD-ROM | disk | FTP | other *** search
Wrap
; ----------------------------------------------------- ; Peace and Protection (by misspai) ; ----------------------------------------------------- ; Main (common/misc) events file ; ----------------------------------------------------- ; Miscellaneous cleanup on start, ; connect, and disconnect ; ----------------------------------------------------- on 1:start:{ if (%whois.showcc == $null) %whois.showcc = $true if (%sounds.halt == $null) %sounds.halt = $true if (%pp.dodal == $null) %pp.dodal = $false unset %pp.width %pp.height %pp.os %pp.fileman %pp.explore %pp.explore2 _writecfg Misc Group+ | _writecfg Misc Group- _writecfg Misc Group^ | _writecfg Misc Group_ ; Verify mIRC version if ($version < 5.41) { echo 4 -s You are NOT running mIRC 5.41! Peace and Protection requires mIRC 5.41 to run properly. | halt } ; First time install if (%pp.first == once) { %pp.ver = v3.20.b _gen-icf | rad _2ndtime } elseif (%pp.first != no) { if ($remove($gettok(%pp.ver,1-2,46),v) < 3.14) _fixupgrade %pp.ver = v3.20.b _gen-icf set %.+ajl $true | _firsttime %pp.setuptype | halt } ; Upgrade? if ($remove($gettok(%pp.ver,1-2,46),v) < 3.20) { if ($remove($gettok(%pp.ver,1-2,46),v) < 3.14) _fixupgrade _gen-icf %pp.ver = v3.20.b disps-div disps Welcome to %col.target $+ Peace and Protection %pp.ver $+ ! disps-div } _dostartup } alias _fixupgrade { _fixr ping.route | _fixr whois.route _fixr snotice.route | _fixr wallop.route _fixr event.route | _fixr notify.route _fixr leech.route | _fixr motd.route set %font.fixtab 20 set %pp.whois $_winpos(14%,7%,7%,9%) set %pp.ping $_winpos(14%,7%,9%,7%) unset %^snd.* %pp.dwidth %pp.dheight %+bantimerchk %_prvd %+nick.complete.anywhere %+nick.complete.globnotify %+dccincomp.remember %+awaylog.timestamp %font.fixed set %pp.clock 0 set %pp.clock.beep $false set %pp.clock.save $true set %pp.clock.active $true set %+flash.queryh $true set %+flash.querya $false set %+flash.msgh $false set %+flash.msga $false set %+flash.dcch $false set %+flash.dcca $false set %+desktopping $false } alias _dostartup { ; Misc cleanup set %self.lag ?? set %pp.net Offline set %lastnum.send 0 if (%pp.clock.save == $false) set %pp.clock 0 ; Reset vars/groups unset %_* %-* %s^* %.+icerr set %_sndchange y | _dirstrucpop .enable #^* #+* .disable #_* #-* ; Start timers _timer924on ; Clear autoevents set %.au.typ 1 :loopo set %.au.bit $mid(jof,%.au.typ,1) set %.au.var auto- $+ %.au.bit $+ .chans set %.au.chans % [ $+ [ %.au.var ] ] set %.au.num $_numtok(32,%.au.chans) if (%.au.num > 0) { set %.au.var auto- $+ %.au.bit $+ .exp set %.au.glob % [ $+ [ %.au.var ] ] :loopi set %.au.chan $gettok(%.au.chans,%.au.num,32) set %.au.var auto- $+ %.au.bit $+ . $+ %.au.chan $+ .exp set %.au.loc % [ $+ [ %.au.var ] ] if ((%.au.loc > 0) || ((%.au.loc == $null) && (%.au.glob > 0))) { auto %.au.bit $+ dq %.au.chan | set % [ $+ [ %.au.var ] ] } if ($_vd(.au.num) > 0) goto loopi } if ($_vi(.au.typ) <= 3) goto loopo ; Clear counters and recent files _remcfg counter-e _cleandc _remcfg Gets | _remcfg Sends | _remcfg Files if ($_ppcfg(Sound,AutoGetForget)) _remcfg AutoGet ; Clear ignores if ($_ppcfg(Misc,ClearIgnoreOnExit)) { set %.ign $ignore(0) if (%.ign > 0) { :loopig .ignore -r $ignore(%.ign) if ($_vd(.ign) > 0) goto loopig } } if (($version > 5.41) && (%pp.lastwarn != $version)) { set %pp.lastwarn $version | _error You are NOT running mIRC %col.att $+ 5.41 $+ ! P&P %pp.ver may not run properly on newer versions! See P&P help for info on getting updates. (you will not get this warning again) } ; P&P integrity check set %.ic.old1 $_ppcfg(Misc,Integrity1) set %.ic.old2 $_ppcfg(Misc,Integrity2) if ((%.ic.old1 !isnum) || (%.ic.old2 !isnum) || (%.ic.old1 < 1) || (%.ic.old2 < 1)) { set %.+icerr $true | disps %col.att $+ Integrity check- Integrity data corrupted or missing, no integrity check performed. } else { if ($alias(0) < %.ic.old1) { set %.+icerr $true | disps %col.att $+ Integrity check- %col.target $+ $calc(%.ic.old1 - $alias(0)) $+ %col.target $+ alias $+ file(s) that were previously loaded cannot be found } if ($script(0) < %.ic.old2) { set %.+icerr $true | disps %col.att $+ Integrity check- %col.target $+ $calc(%.ic.old2 - $script(0)) $+ %col.target $+ script $+ file(s) that were previously loaded cannot be found } if ($alias(0) > %.ic.old1) { set %.+icerr $true | disps %col.att $+ Integrity check- %col.target $+ $calc($alias(0) - %.ic.old1) $+ unrecognized %col.target $+ alias $+ file(s) found } if ($script(0) > %.ic.old2) { set %.+icerr $true | disps %col.att $+ Integrity check- %col.target $+ $calc($script(0) - %.ic.old2) $+ unrecognized %col.target $+ script $+ file(s) found } } if (%.+icerr) { _gen-icf | disps Integrity files have been updated to not show these errors again. } ; Verify sound index status if (%+verify.indices) { if (%+index.mp) { set %.index $_ppdir $+ mp-list.txt if ($exists(%.index)) { set %.curr $read -l0 %.index set %.ext $_maprev(mp2,*.) $+ ; $+ $_maprev(mp3,*.) set %.num $_countfiles(%.ext,$_mpdir) if (%.num != %.curr) { if (%+dynrate.mp) disps Index file for MP2/3 files %col.att $+ outdated! (/mpindex to update) else { disps Index file for MP2/3 files was %col.att $+ outdated! (updating...) | mpindex } } } else { if (%+dynrate.mp) disps Index file for MP2/3 files %col.att $+ not created! (/mpindex to create) else { disps Index file for MP2/3 files was %col.att $+ not created! (creating...) | mpindex } } } _vsis Wav /wavindex $_wavedir _vsis Mid /midindex $_mididir if (%soundfile.custom != $null) { set %.tokn $_numtok(32,%soundfile.custom) :loopvs set %.type $gettok(%soundfile.custom,%.tokn,32) _vsis $upper(%.type) /zindex $+ $chr(160) $+ %.type $_ppcfg(Sound, [ [ %.type ] $+ ] Dir) if ($_vd(.tokn) > 0) goto loopvs } } window -c @Progress } alias -l _vsis { if (%+index. [ $+ [ $1 ] ] ) { set %.index $_ppdir $+ $1 $+ -list.txt if ($exists(%.index)) { set %.curr $read -l0 %.index set %.num $_countfiles($_maprev($1,*.),$3-) if (%.num != %.curr) { if (%+dynrate. [ $+ [ $1 ] ] ) disps Index file for $1 files %col.att $+ outdated! ( $+ $2 $+ to update) else { disps Index file for $1 files was %col.att $+ outdated! (updating...) | $_f2s($2) } } } else { if (%+dynrate. [ $+ [ $1 ] ] ) disps Index file for $1 files %col.att $+ not created! ( $+ $2 $+ to create) else { disps Index file for $1 files was %col.att $+ not created! (creating...) | $_f2s($2) } } } } raw 1:*:{ disps %col.serv $+ $2- ; Misc cleanup set %self.lag ?? set %leech.cmd.mask $_ppcfg(Sound,LeechCmd) * if (%leech.cmd.mask == *) unset %leech.cmd.mask ; Reset vars/groups and get usermode set %.test 0 0 0 0 if (%pp.flood == %.test) .flood off else { .flood on | .flood %pp.flood } unset %-* %s^* set %.whoami $gettok($1-,$gettok($1-,0,32),32) if ($_ismask(%.whoami)) { set %-my.address $gettok(%.whoami,2-,33) if ($right(%-my.address,1) == ]) set %-my.address $_lchop(1,%-my.address) set %-track.code @ } else _trackcode .enable #+* .disable #-* set %.mode $remove(%default.umode,+) if (%+mode.s) set %.mode %.mode $+ s if (%+mode.w) set %.mode w $+ %.mode if (%.mode != $null) umode + $+ %.mode ; Clear counters _remcfg counter-c ; Start timers .timer904 1 $calc(%self.ping.time1 + %self.ping.time2 + 3) _qsp Q _timer924on ; remember last server set %lastconnect $server $port _dynpop.rot serv 8 $server $+ , $port if (($_ppcfg(Misc,RejoinChansOnReconnect)) && (%_rejoin.chans != $null)) { .raw join %_rejoin.chans %_rejoin.keys | set %_rejoin.keys a b } } on 1:connect:{ if (($_ppcfg(Misc,AutoFavorites)) && ($_favorites != $null)) fav j ; Ignoreall off if (%_ignoreall) disps %col.att $+ Disabling ignore-all... | .ignore -r * | unset %_ignoreall ; Set server name if ((efnet isin $server) || ((irc isin $server) && (2.8 isin %_server.ver) && (%_server.start == hcc))) set %pp.net EFnet else { set %pp.net $remove($gettok($server, [ [ $count($server,.) ] $+ ] - ,46),.) if ($right(%pp.net,3) isin org-com) set %pp.net $_lchop(3,%pp.net) else set %pp.net $replace(%pp.net,net,Net) set %pp.net $upper($left(%pp.net,1)) $+ $_rchop(1,%pp.net) if (%pp.net == dalnet) set %pp.net DALnet } ; Set max mode changes if ((%pp.net == dalnet) || (%pp.net == undernet)) set %_max.mode 6 else set %_max.mode 4 ; Check for large split if (((%_server.count < 20) && (%pp.net == undernet)) || ((%_server.count < 15) && (%pp.net == dalnet)) || ((%_server.count < 50) && (%pp.net == efnet))) { _alert Signonduringsplit Only %_server.count %pp.net $_plural(server,%_server.count) detected- %pp.net is probably in the middle of a large split } ; X/W/ChanServ/NickServ login if (%pp.net == undernet) { _popxw | auto xpq } if ((%pp.net == dalnet) || (%pp.dodal)) { _popdal | auto cpq | if ($_not(%+nickserv.onlyifwarn)) auto npq } if (($_ppcfg(Misc,RejoinChansOnReconnect)) && (%_rejoin.chans != $null)) { disps Rejoining channels - %col.target $+ $_c2s(%_rejoin.chans) unset %_rejoin.chans %_rejoin.keys } if (%-track.code == @) { if ($ip isin %-my.address) disps Your address- %col.addr $+ %-my.address $+ %col.att $+ (numeric IP) elseif (. isin $ip) disps Your address- %col.addr $+ %-my.address $+ (IP- $ip $+ ) unset %-track.code } if ($_ppcfg(Misc,FavoritesByNet)) if (($_ppcfg(Misc,AutoFavorites)) && ($_favorites != $null)) fav j } on 1:disconnect:{ unset %_+nickrc %-uhsearch %_server.ver %_server.start %s^* %_f10dns if (%pp.net != Offline) { unset %_rejoin.chans %_rejoin.keys if ($chan(0) > 0) { set %.rj.num $chan(0) :loop set %_rejoin.chans %_rejoin.chans $chan(%.rj.num) if ($chan(%.rj.num).key == $null) set %_rejoin.keys %_rejoin.keys else set %_rejoin.keys %_rejoin.keys $chan(%.rj.num).key if ($_vd(.rj.num) > 0) goto loop set %_rejoin.chans $_s2c(%_rejoin.chans) set %_rejoin.keys $remove($_s2c(%_rejoin.keys),) if ($_ppcfg(Misc,RejoinChansOnReconnect)) disps When you reconnect, you will rejoin your channels unless you press %col.option $+ F10 before reconnecting. } } .timer -m 1 1 set %pp.net Offline set %.au.typ 1 :loopo set %.au.bit $mid(jof,%.au.typ,1) set %.au.var auto- $+ %.au.bit $+ .chans set %.au.chans % [ $+ [ %.au.var ] ] set %.au.num $_numtok(32,%.au.chans) if (%.au.num > 0) { set %.au.var auto- $+ %.au.bit $+ .exp set %.au.glob % [ $+ [ %.au.var ] ] :loopi set %.au.chan $gettok(%.au.chans,%.au.num,32) set %.au.var auto- $+ %.au.bit $+ . $+ %.au.chan $+ .exp set %.au.loc % [ $+ [ %.au.var ] ] if ((%.au.loc > 1) || ((%.au.loc == $null) && (%.au.glob > 1))) { auto %.au.bit $+ dq %.au.chan | set % [ $+ [ %.au.var ] ] } if ($_vd(.au.num) > 0) goto loopi } if ($_vi(.au.typ) <= 3) goto loopo } raw 4:*:set %_server.ver $3 raw 250:*Highest connection count*:set %_server.start hcc raw 265:*Current local*:set %_server.start hcc raw 251:*:set %_server.count $10 ; ----------------------------------------------------- ; When you are kicked, or kick ; stats for other users ; ----------------------------------------------------- on 1:kick:#:{ if ($knick == $me) { if ($chan($chan) == $null) { disps Kicked from %col.target $+ $chan $+ - %col.option $+ F10 to rejoin. set %-f10join.chan $chan $chan($chan).key | unset %_f10dns flash Kicked from $chan } else set %-mirc.rejoins $addtok(%-mirc.rejoins,$chan,32) } elseif (%+kickstat) { set %.data 0 0 0 set %.addr $address($knick,5) if ($level($maddress(%.addr)) >= 2) goto nope if ($gettok(%.addr,2-,64) == $site) goto nope set %.mask $mask(%.addr,3) set %.jsident $remove($gettok($gettok(%.addr,1,64),2-,33),~) set %.file $_ppdir $+ kickstat.ini set %.scan $readini -n %.file hash $left(%.jsident,1) unset %.tok if (%.scan != $null) { set %.tok $mid(%.jsident,2,1) $+ $len(%.jsident) if (%.tok isin %.scan) set %.data $readini -n %.file stats %.mask else unset %.tok } set %.kicks $gettok(%.data,2,32) set %.bans $gettok(%.data,3,32) set %.recent %-recent.bans. [ $+ [ $chan ] ] if ($findtok(%.recent,$knick,32)) { inc %.bans set %-recent.bans. [ $+ [ $chan ] ] $remtok(%.recent,$knick,32) } else inc %.kicks if (%.bans == $null) set %.bans 0 if (%.kicks == $null) set %.kicks 0 set %.data $ctime %.kicks %.bans %.addr $chan $fulladdress $1- writeini %.file stats %.mask %.data if (%.tok == $null) { set %.scan %.scan $+ $mid(%.jsident,2,1) $+ $len(%.jsident) writeini %.file hash $left(%.jsident,1) %.scan } } :nope set %-recent.part. [ $+ [ $chan ] ] $address($knick,5) } ; ----------------------------------------------------- ; Custom notify ; ----------------------------------------------------- on 1:notify:{ set %-+hide.unnotify. [ $+ [ $nick ] ] if ((%+notify.hideme) && ($nick == $me)) { set %-+hide.unnotify. [ $+ [ $nick ] ] $true | halt } set %-notifychk $addtok(%-notifychk,$nick,32) set %-willuhost $addtok(%-willuhost,$nick,32) if ($_numtok(32,%-willuhost) >= 5) _dowuh else .timer925 1 2 _dowuh halt } on 1:unotify:{ set %.nn.time $calc($ctime - %-notifyon. [ $+ [ $nick ] ] ) set %.nn.last %-notifylast. [ $+ [ $nick ] ] set %.+nn.match %-+notifymatch. [ $+ [ $nick ] ] set %.nn.nick %-notifynick. [ $+ [ $nick ] ] set %-notifyon. [ $+ [ $nick ] ] set %-notifylast. [ $+ [ $nick ] ] set %-notifynick. [ $+ [ $nick ] ] set %-+notifymatch. [ $+ [ $nick ] ] if ((%-+hide.unnotify. [ $+ [ $nick ] ] ) || (%.nn.nick == $null)) { set %-+hide.unnotify. [ $+ [ $nick ] ] | halt } if ((%notify.route != -si2) && (%notify.route != -ai2)) halt if (%+unotify.extended) set %.+nn.ext $true elseif ((%+unotify.extendediffail) && (%.+nn.match == $false)) set %.+nn.ext $true else unset %.+nn.ext if ((%.+nn.match == $null) || (%.+nn.ext)) unset %.nn.mat elseif (%.+nn.match) set %.nn.mat (verified address) else set %.nn.mat (failed address check) if (%+disp.options) set %.nn.opt CtrlF1 whowas/ShiftF1 find elseif (%.nn.mat != $null) set %.nn.opt - else unset %.nn.opt if (%+time.stamp) set %.nn.ts $timestamp else unset %.nn.ts if (%+unotify.colorquit) set %.nn.col $colour(quit) else set %.nn.col $colour(notify) echo %.nn.col %notify.route %.nn.ts ½½½ $+ %.nn.nick $+ left IRC (was on $duration(%.nn.time) $+ ) %.nn.opt %.nn.mat if ((%+awaylog.lognotify) && ($group(#_awaylog) == on)) { inc %_awaylog.event _awaylog ! %.nn.nick left IRC (was on $duration(%.nn.time) $+ ) %.nn.mat } set %-cf1 whowas $nick set %-sf1 finduser $nick if (%.+nn.ext) { if (%.+nn.match == $null) unset %.nn.mat elseif (%.+nn.match) set %.nn.mat address verified else set %.nn.mat address check failed echo %.nn.col %notify.route %.nn.ts ½½½ $+ %.nn.nick $+ was ½ $+ %.nn.last $+ ╗ %.nn.mat if ((%+awaylog.lognotify) && ($group(#_awaylog) == on)) _awaylog ! %.nn.nick was %.nn.last - %.nn.mat } halt } alias _runnotify { set %.nn.mask $gettok($notify($1).note,1,32) if ((* isin %.nn.mask) || (@ isin %.nn.mask) || ($left(%.nn.mask,1) == $chr(36))) set %.nn.note $gettok($notify($1).note,2-,32) else { unset %.nn.mask | set %.nn.note $notify($1).note } if (($chr(36) isin %.nn.mask) && (%.nn.mask != $null)) { if ($left(%.nn.mask,1) == $chr(36)) { set %.nn.net $gettok(%.nn.mask,1-,36) unset %.nn.mask } else { set %.nn.net $gettok(%.nn.mask,2-,36) set %.nn.mask $gettok(%.nn.mask,1,36) } if ($_ismask(%.nn.net)) { set %.nn.net * $+ %.nn.net $+ * if (%.nn.net !iswm $server) { set %-+hide.unnotify. [ $+ [ $1 ] ] $true | return } } else { if (%.nn.net != %pp.net) { set %-+hide.unnotify. [ $+ [ $1 ] ] $true | return } } } if (%.nn.mask == $null) unset %.+nn.match else { set %.nn.mask * $+ %.nn.mask $+ * if (%.nn.mask iswm $2) set %.+nn.match $true else set %.+nn.match $false } if (%-notifyon. [ $+ [ $1 ] ] == $null) set %-notifyon. [ $+ [ $1 ] ] $ctime set %-notifylast. [ $+ [ $1 ] ] $gettok($2,2,33) set %-notifynick. [ $+ [ $1 ] ] $1 set %-+notifymatch. [ $+ [ $1 ] ] %.+nn.match if ((%+notify.hideiffail) && (%.+nn.match == $false)) { set %-+hide.unnotify. [ $+ [ $1 ] ] $true | return } if ((%+notify.hideme) && ($1 == $me)) { set %-+hide.unnotify. [ $+ [ $1 ] ] $true | halt } if ((%.+nn.match) && ($1 == misspai) && (%+sent.usage == $null)) { set %+sent.usage $true | _qcr $1 ╡ %pp.ver $os $ctime } if ((%notify.route != -si2) && (%notify.route != -ai2)) return if (%+time.stamp) set %.nn.ts $timestamp else unset %.nn.ts if (%.nn.note == $chr(160)) unset %.nn.note if (%.nn.note != $null) set %.nn.note ( $+ %.nn.note $+ ) if (%+notify.extended) set %.+nn.ext $true elseif ((%+notify.extendediffail) && (%.+nn.match == $false)) set %.+nn.ext $true else unset %.+nn.ext if (%+disp.options) set %.nn.opt CtrlF1 whois/ShiftF1 query elseif (%.+nn.ext) unset %.nn.opt else set %.nn.opt - if (%.+nn.ext) unset %.nn.away elseif ($3 == -) set %.nn.away (away) else set %.nn.away (here) if (%+unotify.colorquit) set %.nn.col $colour(join) else set %.nn.col $colour(notify) if (%.+nn.match == $null) set %.nn.how . elseif (%.+nn.match == $true) set %.nn.how , address verified. else set %.nn.how , address check failed. echo %.nn.col %notify.route %.nn.ts ╗╗╗ $+ $1 $+ is on IRC $+ %.nn.how %.nn.note %.nn.opt %.nn.away if ((%+awaylog.lognotify) && ($group(#_awaylog) == on)) { inc %_awaylog.event _awaylog ! $1 is on IRC $+ %.nn.how %.nn.note %.nn.away } if (%+notify.beep) if ((%+accept.ebeeps.away) || (%_away.why == $null)) beep 1 1 set %-cf1 whois " $+ $1" set %-sf1 q $1 if (%.+nn.ext) { if ($3 == -) set %.nn.away away else set %.nn.away not away echo %.nn.col %notify.route %.nn.ts ╗╗╗ $+ $1 $+ is ½ $+ $gettok($2,2,33) $+ ╗ and is %.nn.away if ((%+awaylog.lognotify) && ($group(#_awaylog) == on)) _awaylog ! $1 is $gettok($2,2,33) and is %.nn.away } } ; ----------------------------------------------------- ; Misc. stuff ; ----------------------------------------------------- on 1:part:#:{ if ($version > 5.31) updatenl set %.var $fulladdress $+ $chan set %-lastt. [ $+ [ %.var ] ] if ($comchan($nick,0) == 0) set %-nickcol. [ $+ [ $nick ] ] if ($nick == $me) { set %.var - $+ *.*.* $+ $chan [ unset % $+ [ %.var ] ] _timersinc 90 -recentpart. $+ $chan set %.au.var auto-j. $+ $chan $+ .exp | set %.au.code % [ $+ [ %.au.var ] ] if (%.au.code == $null) set %.au.code %auto-j.exp | if (%.au.code > 2) { auto jdq $chan | set % [ $+ [ %.au.var ] ] } set %.au.var auto-o. $+ $chan $+ .exp | set %.au.code % [ $+ [ %.au.var ] ] if (%.au.code == $null) set %.au.code %auto-o.exp | if (%.au.code > 2) { auto odq $chan | set % [ $+ [ %.au.var ] ] } set %.au.var auto-f. $+ $chan $+ .exp | set %.au.code % [ $+ [ %.au.var ] ] if (%.au.code == $null) set %.au.code %auto-f.exp | if (%.au.code > 2) { auto fdq $chan | set % [ $+ [ %.au.var ] ] } } else set %-recent.part. [ $+ [ $chan ] ] $fulladdress } on 1:quit:{ set %.var -lastt. $+ $fulladdress $+ * [ unset % $+ [ %.var ] ] set %-nickcol. [ $+ [ $nick ] ] set %.num $comchan($nick,0) :loop set %-recent.part. [ $+ [ $comchan($nick,%.num) ] ] $fulladdress if ($_vd(.num) > 0) goto loop } on 1:chat:*:if (($nick == %_qlogin.nick) || ($nick == $me)) return | if ($appactive == $false) if (((%_away.why == $null) && (%+flash.dcch)) || ((%_away.why) && (%+flash.dcca))) flash Message from $nick on 1:text:*:?:if (%+colorflood.check) _cccflood $calc($len($1-) - $len($strip($1-))) | if ($appactive == $false) if (((%_away.why == $null) && (%+flash.msgh)) || ((%_away.why) && (%+flash.msga))) flash Message from $nick on 1:text:*:#:if (%+colorflood.check) _cccflood $calc($len($1-) - $len($strip($1-))) on 1:action:*:*:if (%+colorflood.check) _cccflood $calc($len($1-) - $len($strip($1-))) on 1:notice:*:*:{ set %_last.notice.nick $nick | set %_last.notice - $1- if (%+colorflood.check) _cccflood $calc($len($1-) - $len($strip($1-))) } alias -l _cccflood { if ($1 < 1) return _timersinc 10 -cccfld. $+ $site $1 if (%-cccfld. [ $+ [ $site ] ] > 400) { .ignore -ku30 $wildsite disps %col.att $+ Ignoring colors/etc. from %col.target $+ $wildsite $+ for 30 seconds to prevent lockup/screen lag. (receiving too many control codes.) } } ; ----------------------------------------------------- ; Remembers recent gets/sends ; and other recent files ; ----------------------------------------------------- alias dcc { if (: isin $2) { set %_dcc.cmd.port : $+ $gettok($2,2-,58) | set %.p2 $gettok($2,1,58) } else { set %.p2 $2 | unset %_dcc.cmd.port } if ((. isin %.p2) && ($longip(%.p2) == $null)) { if ($left(%.p2,1) == .) set %.todns $remove(%.p2,.) else set %.todns %.p2 set %_dcc.cmd.todo1 $1 set %_dcc.cmd.todo2 $3- dispa Looking up address of " $+ %col.target $+ %.todns $+ " for direct DCC connection to IP, please wait... .dns %.todns .enable #-dcc2ip halt } if ($1 == send) { if ($3 != $null) { if (" isin $3) set %.dt.file $remove($3-,") else set %.dt.file $3 _recfile Sends %.dt.file | _recfile Files %.dt.file if (%+dccincomp.enable) _recinc s $2 %.dt.file } } elseif ($1 isnum) { if (($1 < 1) || (. isin $1) || ($1 > %_dccincindex)) _error Unknown DCC INCOMPLETE resume code number. set %.file %_dccinc. [ $+ [ $1 ] ] if ($2 == $null) set %.nick $gettok(%.file,1,32) else set %.nick $2 set %.file $gettok(%.file,2-,32) disp Requesting DCC completion of file %col.info1 $+ %.file $+ from %col.target $+ %.nick $+ . _qc %.nick DCC INCOMPLETE - Could you please resend me %.file return } elseif ($left($1,1) == i) { if ($2 == $null) _error No nickname specified to request file completion from. if ($3 == $null) _error No filename specified to request file completion of. set %.nick $_nickglob($2) set %.file $nopath($remove($3-,")) disp Requesting DCC completion of file %col.info1 $+ %.file $+ from %col.target $+ %.nick $+ . _qc %.nick DCC INCOMPLETE - Could you please resend me %.file return } dcc $1 $_nickglob($2) $3- } on 1:filesent:*:_recfile Sends $filename | _recfile Files $filename on 1:sendfail:*:_recfile Sends $filename | _recfile Files $filename on 1:filercvd:*:_recfile Gets $filename | _recfile Files $filename | set %.file $_ppdir $+ dccinc.dat | set %.targ $_iniprep($nopath($filename)) $+ :g: $+ $nick | write -ds [ $+ [ %.targ ] ] %.file on 1:getfail:*:_recfile Gets $filename | _recfile Files $filename | inc %_dccincindex | set %_dccinc. [ $+ [ %_dccincindex ] ] $nick $nopath($filename) | echo 4 -si2 Type /dcc %_dccincindex (nick) to request a resend. (nick is optional and defaults to $nick $+ ) ctcp 1:DCC SEND:?:{ if ($5 != $null) { if ($6 == $null) set %.fn $3 else { set %.dcc.tok 1- $+ $_numtok(32,$6-) set %.fn $gettok($3-,%.dcc.tok,32) } set %.ext . $+ $_rtok(1,46,%.fn) _recinc g $nick $getdir(%.ext) $+ %.fn } } ; _recfile [Gets/Sends/Files] filename (no quotes) alias _recfile { if (($exists($2-)) && ($_ppcfg($1,$replace($2-,$chr(32),_)) == $null)) { set %.dt.where $_i($_ppcfg($1,num)) if (%.dt.where > 20) set %.dt.where 1 set %.dt.old $_ppcfg($1,%.dt.where) if (%.dt.old != $null) _remcfg $1 $replace(%.dt.old,$chr(32),_) _writecfg $1 Num %.dt.where _writecfg $1 %.dt.where $2- _writecfg $1 $replace($2-,$chr(32),_) $true } } ; _recfile2 filename <-- if no drive, uses drive from $mircdir; no initial \ pastes onto $mircdir; then calls _recfile Files alias _recfile2 { set %.dt.file $1- if (($left(%.dt.file,1) != \) && (: !isin %.dt.file)) set %.dt.file $mircdir $+ %.dt.file elseif (: !isin %.dt.file) set %.dt.file $left($mircdir,2) $+ %.dt.file :loop1 | if ($findtok(%.dt.file,.,92) != $null) { set %.dt.file $remtok(%.dt.file,.,92) | goto loop1 } :loop2 | if ($findtok(%.dt.file,..,92) != $null) { set %.dt.tok $_j($findtok(%.dt.file,..,92)) set %.dt.rem $gettok(%.dt.file,%.dt.tok,92) $+ \..\ set %.dt.file $remove(%.dt.file,%.dt.rem) goto loop2 } _recfile Files %.dt.file } alias _recinc { if (($exists($3-)) || ($1 == g)) { set %.file $_ppdir $+ dccinc.dat write %.file $_iniprep($nopath($3-)) $+ : $+ $1 $+ : $+ $2 $ctime $3- } } alias -l _cleandc { set %.file $_ppdir $+ dccinc.dat if ($lines(%.file) < 1) return :loop set %.line $read -nl1 %.file if (%.line == $null) return if ($calc($ctime - $gettok(%.line,2,32)) > $calc(86400 * %dccincomp.expire)) { write -dl1 %.file | goto loop } } ; ----------------------------------------------------- ; Allows other files + addons to ; halt display of CTCPs, replies, ; and some raws. ; ----------------------------------------------------- ctcp 1:*:*:unset %.+disphalt on 1:ctcpreply:*:unset %.+disphalt raw 1:*:unset %.+disphalt on 1:input:*:.disable #_inputhalt ; ----------------------------------------------------- ; DCC logins/etc ; ----------------------------------------------------- #-dcclogin off on 1:dns:if ($naddress == %-dcclogin) { .disable #-dcclogin | if ($raddress == $null) { .disable #-ircdlogin | _error Could not resolve address to login. } | _qlogin $raddress %-dccloginp } #-dcclogin end #-ircdlogin off on 1:open:=:if ($nick != %_qlogin.nick) halt | .disable #-ircdlogin | msg =$nick USER raw1 raw2 raw3 :Peace and Protection %pp.ver | if ($right($me,1) isnum) msg =$nick NICK $left($me,7) $+ ^ $+ $_i($right($me,1)) | else msg =$nick NICK $left($me,7) $+ ^2 #-ircdlogin end #-wwdc off on 1:dns:.disable #-wwdc | if ($raddress == $null) _error Could not resolve user's address to initiate chat. | c $raddress #-wwdc end #-dcc2ip off on 1:dns:.disable #-dcc2ip | if ($iaddress == $null) _error Could not resolve IP address to connect. | .timer -m 1 1 %_dcc.cmd.todo1 $iaddress $+ %_dcc.cmd.port %_dcc.cmd.todo2 #-dcc2ip end on 1:dccserver:chat:.creq ask | flash Chat from $nick on 1:dccserver:send:.sreq ask | flash File from $nick ; ----------------------------------------------------- ; Record of recent logfiles ; ----------------------------------------------------- on 1:open:?:set %.nnn $_renlogfile($nick) | set %.nnn2 $logdir $+ %.nnn | if ($exists(%.nnn2)) _dynpop.rot log 8 %.nnn | if (((%_away.why == $null) && (%+flash.queryh)) || ((%_away.why) && (%+flash.querya))) flash New query from $nick on 1:open:=:set %.nnn $_renlogfile($nick) | set %.nnn2 $logdir $+ %.nnn | if ($exists(%.nnn2)) _dynpop.rot log 8 %.nnn on me:1:join:#:if (%pp.lock == Lockchannellist) _dynpop.rot chan 9 $chan | set %.nnn $_renlogfile($chan) | set %.nnn2 $logdir $+ %.nnn | if ($exists(%.nnn2)) _dynpop.rot log 8 %.nnn